package com.lanou.mapper;

import com.lanou.entity.Course;
import com.lanou.entity.CourseCollect;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CourseCollectMapper {
    //增加收藏
    int addCourseCollect(CourseCollect courseCollect);
    //删除收藏
    int deleteCourseCollect(CourseCollect courseCollect);
//    int updateCourseCollect(CourseCollect courseCollect);
    //根据用户id和文章查询用户是否收藏该课程
    CourseCollect getCourseCollectByCidAndUId(CourseCollect courseCollect);
    //根据用户id查询用户所有收藏课程
    List<CourseCollect> getCourseCollectByUserId(Integer userId);
    //根据用户id和课程id修改支付状态
    int updateCourseCollect(CourseCollect courseCollect);

    //根据用户id查询用户所有收藏课程
    List<Course> getCollectCourseByUserId(@Param("userId") Integer userId,@Param("status") String status);
}
